fix(update): allow stable updates from older previews - #871
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughChangesPreview update comparison
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc0a569c17
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (channel === "latest") { | ||
| const l = parseStable(latest); | ||
| const c = parseStable(current); | ||
| const c = parseStable(current) ?? parsePreview(current)?.slice(0, 3); |
There was a problem hiding this comment.
Parse multi-component preview identifiers
When the installed build has a supported multi-component prerelease such as 2.8.2-preview.20260731.2, parsePreview() rejects it because its regex permits exactly one numeric component after preview. The release tooling accepts this form, and tests/release-notes.test.ts explicitly exercises same-day suffixes such as .2 and .10; consequently this branch still returns false and the GUI/API reports already_latest even when stable 2.9.1 is available. Parse the core independently of the complete prerelease identifier, or allow all supported numeric components, and cover this form in the update tests.
Useful? React with 👍 / 👎.
…nnel Takeover of PR #871's fix. An installed preview such as 2.8.2-preview.20260731 made parseStable(current) return null on the latest channel, so isNewer() returned false and the GUI reported already_latest with one-click update disabled. The current side now falls back to the preview's major.minor.patch core; the target side stays strict (a preview registry target is never accepted on latest). Same-base stays not-newer, mirroring the preview channel's O3 rule — semver §9 tension and the respin-format known limitation are recorded in devlog/_plan/260802_wt1_update_path_star_prompt/011.
|
Superseded by #892, which lands this fix natively (installed previews now compare by their major.minor.patch core on the latest channel; the registry-target side stays strict). The comparator change, the GUI/API availability path, and the semver §9 / respin-format limitations are all covered with regression tests and an independent review. Thank you — the report and the initial patch drove the fix. |
Campaign preparation (docs-only): five units under devlog/_plan/260802_wtN_* with 000 research + 010 implementation roadmaps, claim ledgers verified by a lunasearch fan-out (Anthropic 1M windows, Copilot mixed-wire, DeepSeek service_tier, WHATWG extension origins, POSIX rename-over-symlink). wt1 update-path: PR lidge-jun#871, issue lidge-jun#879 (star-prompt deferral leakage), lidge-jun#557 optional wt2 zero-leak: PRs lidge-jun#840 lidge-jun#841 lidge-jun#843 lidge-jun#844 lidge-jun#845 lidge-jun#847 (tracker lidge-jun#820) wt3 provider-wire: PRs lidge-jun#746 lidge-jun#860 lidge-jun#839/lidge-jun#854, issue lidge-jun#875 triage, lidge-jun#616/lidge-jun#837 optional wt4 server-config: PRs lidge-jun#850 (CORS origin confusion), lidge-jun#869 (symlink destruction) wt5 windows-service: PRs lidge-jun#868, lidge-jun#861 (issue lidge-jun#848)
Summary
major.minor.patchcore when the selected update channel islatest.Problem
An older preview install such as
2.8.2-preview.20260731cannot be parsed by the stable-only current-version branch. With npmlatestat2.9.1,isNewer()therefore returnsfalse, and the dashboard incorrectly reportsalready_latestand disables one-click update.Behavior
latest=2.9.1,current=2.8.2-preview.20260731: update available.latest=2.9.1,current=2.9.1-preview.20260731: no update, preserving the existing core-version comparison policy.latesttarget remains rejected.Verification
bun test tests/update-notify.test.ts tests/update-job.test.ts: 60 passed, 0 failed, 152 assertions.bun run typecheck: passed.bun run privacy:scan: passed.git diff --check upstream/dev...HEAD: passed.No documentation change is included because this restores the documented existing update-channel behavior rather than adding a new user-facing option.
Summary by CodeRabbit
Bug Fixes
Tests